export {};

// 定义对象类型别名
type Person = {
  name: string;
  sayHi(info: string): void;
};

let person1: Person = {
  name: 'jack',
  sayHi(info) {
    console.log(info);
    return 'info';
  },
};

const result = person1.sayHi('help');
console.log('====>', result);

// 箭头函数定义对象属性

type Person2 = {
  name: string;
  sayHi: (info: string) => void;
};

let person2: Person2 = {
  name: 'jack',
  sayHi: (info) => {
    console.log(info);
  },
};

// const fn = (num: number): void => {
//   console.log(num)
//   return 'xx'
// }
